package com.iocup.keybastion.core.session;


import com.iocup.keybastion.authentication.AccessToken;
import com.iocup.keybastion.core.profile.UserProfile;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * @author xyjxust
 * @create 2022/3/4 13:02
 **/
@Getter
@Setter
public class Session implements Serializable {
    /**
     * id
     */
    private String id;
    /**
     * 用户绑定的token信息
     */
    private AccessToken token;
    /**
     * 用户信息
     */
    private UserProfile userProfile;


    public static Session build() {
        return new Session();
    }

    public Session id(String id) {
        this.id = id;
        return this;
    }

    public Session token(AccessToken token) {
        this.token = token;
        return this;
    }

    public Session userProfile(UserProfile userProfile) {
        this.userProfile = userProfile;
        return this;
    }
}
